<?php
/*! \brief
 * This is WFExceptionFactory class
 * This is the Simple Factory Class that create relative Exception Class
 * \author William Su
 */
class WFExceptionFactory
{
    private static $instance;
    /**
     * @return Exception
     */
    /*public function getException($message){
        ////if(!self::$instance[__CLASS__][__FUNCTION__]){
            $ret = new Exception($message);
        ////}
        return $ret;
    }
    
    public function getExceptionWidgetPoolManager($message){
        $ret = new Exception($message);
        return $ret;
    }*/
    public static function getDirnameFile(){
        if(!isset(self::$instance[__FUNCTION__])){
            self::$instance[__FUNCTION__] = dirname(__FILE__);
        }
        return self::$instance[__FUNCTION__];
    }
    /**
     * @return WFExceptionHandler
     */
    public function getExceptionHandler(){
        if(!isset(self::$instance[__CLASS__][__FUNCTION__])){
            require_once(self::getDirnameFile().'/ExceptionHandler.php');
            self::$instance[__CLASS__][__FUNCTION__] = new WFExceptionHandler();
        }
        return self::$instance[__CLASS__][__FUNCTION__];
    }
}